# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=upnpscan
pkgver=0.4
pkgrel=4
groups=('blackarch' 'blackarch-scanner')
pkgdesc='Scans the LAN or a given address range for UPnP capable devices.'
arch=('x86_64' 'aarch64')
url='http://www.cqure.net/wp/upnpscan/'
license=('GPL3')
depends=('libpcap')
makedepends=('libtool' 'autoconf')
source=("http://www.cqure.net/tools/$pkgname-v$pkgver-src.tgz")
sha512sums=('d7791afdc6d3f318a1a29486485ab5f71a1a32159a2212164c763748a047c8243e3017afc887e9394ae78ffc2412091ed590a714c4a482b44792ae8a835e095e')

build() {
  cd $pkgname

  libtoolize --copy --force -i
  aclocal
  autoconf
  automake --add-missing

  ./configure --prefix=/usr

  make
}

package() {
  cd $pkgname

  install -Dm 755 src/upnpscan "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}

